package com.home.demo;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;

public class HandleEvent extends JFrame {
	public HandleEvent() {
		JButton jbtok = new JButton("OK");
		JButton jbtcancel = new JButton("Cancel");
		JPanel jpl = new JPanel();
		jpl.add(jbtok);
		jpl.add(jbtcancel);
		add(jpl);
	}

	public static void main(String[] args) {

	}
}

class okListener implements ActionListener {
	public void actionPerformed(ActionEvent e) {
		System.out.print("OK");
	}
}

class cancelListener implements ActionListener {
	public void actionPerformed(ActionEvent e) {
		System.out.print("Cancel");
	}
}
